import React, { PureComponent } from 'react';
import { Card,Button, WhiteSpace, WingBlank } from 'antd-mobile';
import { routerRedux } from 'dva/router';
import { connect } from 'dva';
import img3 from '../../assets/img/3.jpg';


class MyMessage extends PureComponent {
  state = {
    selectedTab: 'redTab',
    hidden: false,
    fullScreen: false,
  };
  changeRouter = index => {
    switch (index){
      case 1:
        this.props.dispatch(routerRedux.push('/oldlist'));
        break;
      case 2:
        this.props.dispatch(routerRedux.push('/unreceivedorder'));
        break;
      case 3:
        this.props.dispatch(routerRedux.push('/oldlist'));
        break;
    }
  }
  render() {
    console.log("aaaaaaaa")
    return (
      <div>
        <WingBlank>
        <WhiteSpace/>
        <WhiteSpace/>
        <Card>
          <Card.Header
            title="商家名称"
            thumb={img3}

            thumbStyle={{height:"40%", width:"40%"}}
            extra={<span>此处显示商家名称</span>}
          />
          <Card.Body>
            <div>此处显示收货地址</div>
          </Card.Body>
          <Card.Footer content="footer content" extra={<div>extra footer content</div>} />
        </Card>
        <WhiteSpace/>
        <WhiteSpace/>
        <WhiteSpace/>
            <WhiteSpace/>
            <Button onClick={()=>this.changeRouter(1)}>历史订单</Button>
            <WhiteSpace/>
            <WhiteSpace/>
            <Button onClick={()=>this.changeRouter(2)} >未完成订单</Button>
            <WhiteSpace />
            <WhiteSpace/>
            <Button onClick={()=>this.changeRouter(3) }>待收货订单</Button>
            <WhiteSpace/>
        </WingBlank>
      </div>
    );
  }
}
export default connect(({ mymessage }) => ({
  mymessage,
}))(MyMessage)
